import time

from selenium import webdriver
from .radio import Radio
from ...common.ui.Selector import Selector


def test_checkbox_antd3x():
    browser = webdriver.Chrome()
    browser.maximize_window()
    browser.get("https://3x.ant.design/components/radio-cn/")

    # 单个
    radio = Radio(browser, '//section[@id="components-radio-demo-basic"]/section/label[contains(@class,"ant-radio-wrapper")]', Selector.XPATH)
    radio.setValue('True')

    # 一组
    radio = Radio(browser,
                      '//section[@id="components-radio-demo-radiogroup"]//div[contains(@class,"ant-radio-group")]',
                   Selector.XPATH)
    radio.setValue('D')
    time.sleep(10)

    radio.setValue('B')
    time.sleep(10)
    browser.close()
